﻿using UnityEngine;
using System.Collections;

namespace Room
{
    public class RCMoveFixed : RCMoveBase
    {
        public RCMoveFixed(RoomCharactor owner)
            : base(owner)
        {
            type = MoveType.Fixed;
        }
        
        public void Init(Vector3 pos,float angle)
        {
            owner.transform.position = pos;
            owner.transform.localRotation = Quaternion.Euler (new Vector3(0, angle, 0));
        }
        

        public void Init(ProtoBuf.Message.WorldBossStrongholdInfo info)
        {
            var dict = Dict.Blo.DictWorldBossBlo.GetTableWorldBossStronghold(info.strongholdId);
            if (dict != null)
            {
                Vector3 pos = TableConvertUtil.String2Vector3(dict.StrongholdPos);
                Vector3 euler = new Vector3(0, Random.Range(0, 360), 0);
                owner.transform.position = pos;
                owner.transform.localEulerAngles = euler;
            }
        }
    }
}